﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Algorithm_api.calculate.GeneContrast
{
    public class Gene
    {
        public int[][] PartitionMatrix { get; set; }
        public Dictionary<char, int> dic { get; set; }

        public Gene()
        {
            PartitionMatrix = new int[5][] {  //初始化基因分值矩阵
                new int[] { 5, -1, -2, -1, -3},
                new int[] {-1,  5, -3, -2, -4},
                new int[] {-2, -3,  5, -2, -2},
                new int[] {-1, -2, -2,  5, -1},
                new int[] {-3, -4, -2, -1,  0},
            };

            dic = new Dictionary<char, int>();
            dic.Add('A', 0);
            dic.Add('C', 1);
            dic.Add('G', 2);
            dic.Add('T', 3);
            dic.Add('_', 4);
        }

        public int GetPartition(char c1,char c2)
        {
            return PartitionMatrix[dic[c1]][dic[c2]];
        }


    }
}
